package old.proxy.demo2;

public class ServiceProxy implements UserService {
    UserServiceImp userServiceImp;

    public ServiceProxy(UserServiceImp userServiceImp) {
        this.userServiceImp = userServiceImp;
    }

    @Override
    public void add() {
        log("add ");
        userServiceImp.add();
    }

    @Override
    public void update() {
        log("delete ");
        userServiceImp.update();
    }

    @Override
    public void delete() {
        log("delete ");
        userServiceImp.delete();
    }

    @Override
    public void query() {
        log("query");
        userServiceImp.query();
    }

    void log(String msg){
        System.out.println("调用了===>" + msg);
    }
}
